package yangsw87.basic;

public class J10_Ex73_OOPb {

	public static void main(String[] args) {

		Fan f = new Fan();

		f.setRadius(10);
		f.setColor("yellow");
		f.setSpeed(3);
		f.setOn(true);
		System.out.println(f.toString());

		f.setRadius(5);
		f.setColor("blue");
		f.setSpeed(2);
		f.setOn(false);
		System.out.println(f.toString());

	}

}

class Fan {
	private final int slow = 1;
	private final int medium = 2;
	private final int fast = 3;
	private int speed;
	private boolean on;
	private double radius;
	private String color;

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	public void setOn(boolean on) {
		this.on = on;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}

	public void setColor(String color) {
		this.color = color;
	}

	// setter

	public String getSpeed() {
		String a = "";
		switch (speed) {
		case 1:
			a = "최저속도";
			break;
		case 2:
			a = "중간속도";
			break;
		case 3:
			a = "최고속도";
		}
		return a;
	}

	public String getOn() {
		String b = "";
		if (on == true) {
			b = "동작중";
		} else {
			b = "정지";
		}
		return b;
	}

	public double getRadius() {
		return radius;
	}

	public String getColor() {
		return color;
	}

	// getter

	@Override
	public String toString() {
		String result = "";
		result = result + " 팬크기 : " + radius + "\n";
		result += " 색상 : " + color + "\n";
		result += " 속도 : " + getSpeed() + "\n";
		result += " 동작상태 : " + getOn() + "\n";
		return result;
	}
}
